package com.xinchuang.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xinchuang.entity.MoldSelection;
import com.xinchuang.mapper.MoldSelectionMapper;
import com.xinchuang.service.IMoldSelectionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2023-09-06
 */
@Service
public class MoldSelectionServiceImpl extends ServiceImpl<MoldSelectionMapper, MoldSelection> implements IMoldSelectionService {

    @Override
    public String getProjectName(String moldSelectionId) {
        MoldSelection moldSelection = getOne(new LambdaQueryWrapper<MoldSelection>().eq(MoldSelection::getMoldSelectionId, moldSelectionId));
        if (ObjectUtil.isNull(moldSelection)) {
            return "";
        } else {
            return moldSelection.getProjectName();
        }
    }
}
